/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package com.cardarus.operatingsystem.domain;

import java.io.Serializable;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.OneToOne;

/**
 * This class represents the payment of one SalesTransaction
 *
 * @author Javier Snaider
 */
@Entity
public class Payment implements Serializable {
    /**
     * ID of the payment
     */
    @Id
    @GeneratedValue(strategy = GenerationType.AUTO)
    private int id;
    
    /**
     * The payment method
     */
    private PaymentMethod paymentMethod;
    
    /**
     * the card detail
     */
    private String cardDetail;
    
    /**
     * The authorization code
     */
    private String authorizationCode;
    
    /**
     * The sale record
     */
    @OneToOne(mappedBy = "payment")
    private SalesTransaction salesRecord;

    /**
     * @return The id of the payment
     */
    public int getId() {
        return id;
    }

    /**
     * @param id
     */
    public void setId(int id) {
        this.id = id;
    }

    /**
     * @return the paymentMethod
     */
    public PaymentMethod getPaymentMethod() {
        return paymentMethod;
    }

    /**
     * @param paymentMethod the paymentMethod to set
     */
    public void setPaymentMethod(PaymentMethod paymentMethod) {
        this.paymentMethod = paymentMethod;
    }

    /**
     * @return the cardDetail
     */
    public String getCardDetail() {
        return cardDetail;
    }

    /**
     * @param cardDetail the cardDetail to set
     */
    public void setCardDetail(String cardDetail) {
        this.cardDetail = cardDetail;
    }

    /**
     * @return the authorizationCode
     */
    public String getAuthorizationCode() {
        return authorizationCode;
    }

    /**
     * @param authorizationCode the authorizationCode to set
     */
    public void setAuthorizationCode(String authorizationCode) {
        this.authorizationCode = authorizationCode;
    }

    /**
     * @return the salesRecord
     */
    public SalesTransaction getSalesRecord() {
        return salesRecord;
    }

    /**
     * @param salesRecord the salesRecord to set
     */
    public void setSalesRecord(SalesTransaction salesRecord) {
        this.salesRecord = salesRecord;
    }
}
